<?php

    require_once Core_IO_Path::combine(SERUM_MODULE_PATH, 'Base', 'controllers', 'admin', 'IndexController.php');
    
    /**
     * @package      Modules
     * @subpackage   Admins_Controllers_Admin
	 *
     * @license      GNU Lesser General Public Licence see LICENCE-LGPL file or http://www.gnu.org/licenses/lgpl.html
     */
    class Admins_Controllers_Admin_Index extends Base_Controllers_Admin_Index
    {

	////////////////////////////////////////////////////////////////////////////
	//                                Variables                               //
	////////////////////////////////////////////////////////////////////////////

		/**
         * Model class
         * 
         * @var string
         */
		protected $_model       = 'DbAdmin';
		
		/**
         * Parent class
         * 
         * @var string
         */
		protected $_parent      = 'DbProfile';

	////////////////////////////////////////////////////////////////////////////
	//                                Public Methods                          //
	////////////////////////////////////////////////////////////////////////////

        /**
         * Displays my account
         *
         * @return      Core_Controller_Response_Abstract
         */
        public function myAccount()
        {
            $rep = $this->_getResponse('json');

            $authNamespace = Core_Authentification::getNamespace();

            $rep->setResponseContent($this->_prepareEditionVariables($rep, 'edit', $this->_model, $authNamespace->id));

            return $rep;
        }

        /**
         * Saves my account
         *
         * @return      Core_Controller_Response_Abstract
         */
        public function saveMyAccount()
        {
            $authNamespace = Core_Authentification::getNamespace();
            $this->_setParam('id', $authNamespace->id);
            $this->_setParam('todoaction', 'edit');
            return parent::save();
        }
    }
